<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name = "viewport" content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
        <title></title>
        <script src="C:/Users/24098/Desktop/978-7-302-48199-7《HTML5 App应用开发教程》教辅/配套资源包/chapter06/scripts/jquery-3.1.1.min.js"></script>
    </head>
    <body>
        <input type="button" value="按钮事件监听" id="mybutton" />
        <input type="button" value="只执行一次单击的按钮" id ="mybutton1" />
        <script>
            $(function()
            { 
                $("#mybutton").click("数据1",function(e){console.log("按钮单击事件1，参数的值："+e.data);});
                $("#mybutton").click(function(){console.log("按钮单击事件2")});
                $("#mybutton").on("click",{"myvalue":"数据2"},
                function(e){
                    console.log("按钮单击事件3，参数的值："+e.data.myvalue);
                });
                $("#mybutton").on("click",function(){
                    console.log("按钮单击事件4");
                });
                $("#mybutton").bind("click","数据3",function(e){
                    console.log("按钮单击事件5，参数的值"+e.data);
                });
                $("#mybutton").bind("click",function(){
                    console.log("按钮单击事件6");
                    $(this).unbind("click");
                });
                $("#mybutton1").one("click",function(){
                    alert("只能执行一次单击");
                })
            });
            
        </script>

    </body>
</html>